home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / auror300.zip / TEMPLATE.DAT < prev    next >
Text File  |  1996-07-17  |  4KB  |  198 lines

  1.  
  2. Template Data File
  3. ------------------
  4. Template editing allows you include commonly-used blocks of code or text
  5. (called 'templates') into the current file with just a few keystrokes.
  6. Templates are selected based on the current file extension, and may
  7. contain program code, text, or even macro expressions.
  8.  
  9. This data file contains sample AML and C/C++ templates for use with the
  10. TEMPLATE.AML macro, and must be placed in the MACRO subdirectory. You
  11. can easily modify this file for use with other languages or text files.
  12.  
  13. Templates must be defined in the following format:
  14.  
  15. template_keyword.extensions  [lines_in_the_template]
  16. [template data]
  17. [template data]
  18.  :
  19.  :
  20.  
  21. The template keyword must begin in column one. [lines_in_the_template]
  22. is only required when the template data contains blank lines, otherwise
  23. the template data is delimited by the next blank line. A '\c' in the
  24. template data indicates the position in the template where the cursor
  25. should be placed when the template is used. For example:
  26.  
  27.   // if-then-end
  28.   if.aml
  29.   if \c then
  30.   end
  31.  
  32. To use a template, type in the template keyword and press the template
  33. expansion key (<ctrl f3> is the default). The template macro will select
  34. the appropriate template from this file, based on the extension of the
  35. file you are editing.
  36.  
  37. Templates defined in TEMPLATE.DAT with an extension of '.' (no
  38. extension) are active in files with any extension. For example:
  39.  
  40.   // the 'etc' template works in any file:
  41.   etc.
  42.   et cetera
  43.  
  44. Templates can also be enabled for multiple file extensions by listing
  45. each extension after the template keyword. For example:
  46.  
  47.   // the 'struct' template is enabled in .C, .CPP, .H, and .HPP files:
  48.   struct.c.cpp.h.hpp
  49.   typedef struct {
  50.   } \c;
  51.  
  52. Macro expressions may be also be embedded within a template. When a
  53. template containing macro expressions is used, each macro expression in
  54. the template will be evaluated and replaced with its value. Embedded
  55. expressions must be entered in the following format: \{expression}.
  56. For example:  The date and time is \{getdate + ' ' + gettime}
  57.  
  58. ========================================================================
  59.  
  60.  
  61. // AML Templates -------------------------------------------
  62.  
  63. // case statement
  64. ca.aml
  65. case \c
  66.   when
  67.   when
  68.   otherwise
  69. end
  70.  
  71. // databuf-end
  72. db.aml
  73. databuf "\c"
  74. end
  75.  
  76. // define-end
  77. de.aml
  78. define
  79.   \c
  80. end
  81.  
  82. // function-end
  83. fu.aml
  84. function \c
  85. end
  86.  
  87. // if-else-end
  88. if.aml
  89. if \c then
  90. else
  91. end
  92.  
  93. // key-end
  94. ke.aml
  95. key <\c>
  96. end
  97.  
  98. // loop-end
  99. lo.aml
  100. loop
  101.   \c
  102. end
  103.  
  104. // menu-item-end
  105. me.aml
  106. menu "\c"
  107.   item ""
  108.   item ""
  109. end
  110.  
  111. // repeat-until
  112. re.aml
  113. repeat
  114.   \c
  115. until
  116.  
  117. // while do-end
  118. wh.aml 3
  119. while \c do
  120.  
  121. end
  122.  
  123.  
  124. // C/C++ Templates -----------------------------------------
  125.  
  126. // class
  127. cl.c.cpp.h
  128. class \c {
  129.   protected:
  130.   public:
  131. }
  132.  
  133. // do while
  134. do.c.cpp
  135. do {
  136.   \c
  137. }
  138. while ();
  139.  
  140. // for
  141. fo.c.cpp
  142. for (\c;;) {
  143. }
  144.  
  145. // if
  146. if.c.cpp
  147. if (\c) {
  148. }
  149.  
  150. // function
  151. fu.c.cpp
  152. void \cfunc (void)
  153. {
  154. }
  155.  
  156. // main
  157. ma.c.cpp
  158. void main(void) {
  159.   \c
  160. }
  161.  
  162. // struct
  163. st.c.cpp.h
  164. typedef struct {
  165. } \c;
  166.  
  167. // switch
  168. sw.c.cpp
  169. switch (\c) {
  170.   case :
  171.     break;
  172.   case :
  173.     break;
  174. }
  175.  
  176. //union
  177. un.c.cpp.h
  178. union {
  179. } \c;
  180.  
  181. // while
  182. wh.c.cpp
  183. while (\c) {
  184. }
  185.  
  186.  
  187. // Templates for any file extension ------------------------
  188.  
  189. // sample 'tagline' template - illustrates embedded macro expressions
  190. tag.
  191. +-------------------------------------+-----------------------------------+
  192. | John Doe                            |  Tel.   123-456-7890              |
  193. | XYZ Enterprises                     |  Fax:   987-654-3210              |
  194. | 1234 Oak Street                     |  Email: john.doe@xyz.com          |
  195. | Washington, DC 20015  USA           |                                   |
  196. +-------------------------------------+-----------------------------------+
  197. * Message composed with Aurora v\{getversion}, \{gettime + ' ' + getdate}
  198.